#include "Primitives.h"

Sphere::Sphere(GLdouble radius,
	                  GLint slices, GLint stacks){
	this->radius = radius;
	this->slices = slices;
	this->stacks = stacks;
	centerBS = new Vector3();
}

void Sphere::render(){
	glPushMatrix();
		glutSolidSphere(radius, slices, stacks);	
	glPopMatrix();
}

void Sphere::boundingSphere(Matrix4 *c, Texture *t){
	float *m = (float*)malloc(sizeof(float)*16);
	m = c->get();
	centerBS->set(m[12], m[13], m[14]);	
	radiusBS = radius;
	this->t = t;
}
